package com.matt.foundation.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/7/18
 * *******************************
 */
@Data
public class AppUserDetailVo {

    private String id;

    private String name;

    private String phone;

    private String company;

    private String email;

    private String province;

    private String city;

    private String district;

    private String detailedAddress;

    private String education;

    private String position;

    private String relation;

    private String remark;

    private String rid;

    private Boolean cameraEnabled ;
    private Boolean wechatEnabled ;
    private Boolean templateMsgEnabled ;
    private Boolean teacherChatEnabled ;

    public static AppUserDetailVo of(Object[] objects) {
        AppUserDetailVo vo = new AppUserDetailVo();
        vo.setId(objects[0] == null ? "" : objects[0].toString());
        vo.setRid(objects[1] == null ? "" : objects[1].toString());
        vo.setName(objects[2] == null ?  "" : objects[2].toString());
        vo.setPhone(objects[3] == null ?  "" : objects[3].toString());
        vo.setCompany(objects[4] == null ?  "" : objects[4].toString());
        vo.setEmail(objects[5] == null ?  "" : objects[5].toString());
        vo.setRelation(objects[6] == null ?  "" : objects[6].toString());
        vo.setRemark(objects[7] == null ?  "" : objects[7].toString());
        vo.setCameraEnabled(objects[8] == null ?  true : (Boolean) objects[8]);
        vo.setWechatEnabled(objects[9] == null ?  true : (Boolean)objects[9]);
        vo.setTemplateMsgEnabled(objects[10] == null ?  true : (Boolean)objects[10]);
        vo.setTeacherChatEnabled(objects[11] == null ?  true : (Boolean)objects[11]);
        vo.setProvince(objects[12] == null ?  "" : objects[12].toString());
        vo.setCity(objects[13] == null ?  "" : objects[13].toString());
        vo.setDistrict(objects[14] == null ?  "" : objects[14].toString());
        vo.setDetailedAddress(objects[15] == null ?  "" : objects[15].toString());
        vo.setEducation(objects[16] == null ?  "" : objects[16].toString());
        vo.setPosition(objects[17] == null ?  "" : objects[17].toString());
        return vo;
    }

}
